import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'
// import locale from 'element-plus/lib/locale/lang/zh-cn'
// 导入Element Plus的图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入echarts
import * as echarts from 'echarts'

const app = createApp(App)
// 注册Element Plus图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 定义全局的map对象
const map = {}

// 定义全局的viewer对象
const viewer = {}

// 配置请求的根路径
// axios.defaults.baseURL = 'http://localhost:8090/iserver/services'
axios.defaults.baseURL = 'http://172.16.15.83:8090/iserver/services'

// 全局挂载map
app.config.globalProperties.$map = map

// 挂载viewer
app.config.globalProperties.$viewer = viewer

// 全局挂载axios
app.config.globalProperties.$http = axios

// 全局挂载echarts
app.config.globalProperties.$echarts = echarts

app.use(router).use(ElementPlus).mount('#app')
